package org.uk.splitsbrowser.client.view;


import org.uk.splitsbrowser.shared.FieldVerifier;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.MenuBar;

import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.IntegerBox;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.ToggleButton;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.TabLayoutPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.Cell.Context;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.ui.ValueListBox;
import com.google.gwt.text.client.IntegerRenderer;
import com.google.gwt.user.cellview.client.DataGrid;
import org.uk.splitsbrowser.shared.OEvent;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Splitsbrowser_old implements EntryPoint {


	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		RootPanel rootPanel = RootPanel.get("nameFieldContainer");
		
		// Make some sub-menus that we will cascade from the top menu.
		
		// Make a command that we will execute from all leaves.
	/*    Command cmd = new Command() {
	      public void execute() {
	        Window.alert("You selected a menu item!");
	      }
	    };

	    MenuBar maninMenu = new MenuBar();
	    
	    maninMenu.setAutoOpen(true);
	    maninMenu.setWidth("100px");
	    maninMenu.setAnimationEnabled(true);

	    maninMenu.addItem(new MenuItem("the", cmd));
	    maninMenu.addItem(new MenuItem("foo", cmd));
	    maninMenu.addItem(new MenuItem("menu", cmd));
	    
	    RootPanel.get().add(maninMenu);  */
		
		DockLayoutPanel appPanel = new DockLayoutPanel(Unit.EM);
		RootLayoutPanel.get().add(appPanel);
		
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		horizontalPanel.setSpacing(15);
		horizontalPanel.setBorderWidth(1);
		appPanel.addNorth(horizontalPanel, 4.3);
		
		ToggleButton tglbtnUpText = new ToggleButton("Select Event");
		horizontalPanel.add(tglbtnUpText);
		
		ToggleButton tglbtnUpText_1 = new ToggleButton("Up text");
		tglbtnUpText_1.setDown(true);
		horizontalPanel.add(tglbtnUpText_1);
		
		ToggleButton tglbtnUpText_2 = new ToggleButton("Up text");
		tglbtnUpText_2.setDown(true);
		horizontalPanel.add(tglbtnUpText_2);
		
		ToggleButton tglbtnUpText_3 = new ToggleButton("Up text");
		tglbtnUpText_3.setDown(true);
		horizontalPanel.add(tglbtnUpText_3);
		
		TabLayoutPanel tabLayoutPanel = new TabLayoutPanel(1.5, Unit.EM);
		tabLayoutPanel.setAnimationVertical(true);
		tabLayoutPanel.setAnimationDuration(10);
		
		DockPanel dockPanel = new DockPanel();
		tabLayoutPanel.add(dockPanel, "Graph", false);
		
		VerticalPanel verticalPanel = new VerticalPanel();
		dockPanel.add(verticalPanel, DockPanel.WEST);
		
		PushButton pshbtnNewButton = new PushButton("New button");
		verticalPanel.add(pshbtnNewButton);
		
		PushButton pshbtnNewButton_4 = new PushButton("New button");
		verticalPanel.add(pshbtnNewButton_4);
		
		PushButton pshbtnNewButton_3 = new PushButton("New button");
		verticalPanel.add(pshbtnNewButton_3);
		
		PushButton pshbtnNewButton_2 = new PushButton("New button");
		verticalPanel.add(pshbtnNewButton_2);
		
		PushButton pshbtnNewButton_1 = new PushButton("New button");
		verticalPanel.add(pshbtnNewButton_1);
		
		DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.EM);
		tabLayoutPanel.add(dockLayoutPanel, "Results", false);
		
		SplitLayoutPanel splitLayoutPanel = new SplitLayoutPanel();
		dockLayoutPanel.addWest(splitLayoutPanel, 7.7);
		
		CellList<Object> cellList = new CellList<Object>(new AbstractCell<Object>(){
			@Override
			public void render(Context context, Object value, SafeHtmlBuilder sb) {
				// TODO
			}
		});
		splitLayoutPanel.addWest(cellList, 1.0);
		appPanel.add(tabLayoutPanel);

	}
}
